package top.lingkang.securityoauth2.server.store;

import top.lingkang.securityoauth2.core.entity.RefreshToken;
import top.lingkang.securityoauth2.core.entity.UserDetail;
import top.lingkang.securityoauth2.core.entity.AccessToken;

/**
 * @author lingkang
 * Created by 2022/7/1
 */
public interface TokenStore {
    AccessToken getAccessToken(String token);

    UserDetail getUserDetail(String token);

    RefreshToken getRefreshToken(String refreshToken);

    String getTokenByRefreshToken(String refreshToken);

    void setAccessToken(String token, AccessToken accessToken);

    void setRefreshToken(String refreshToken,RefreshToken refresh_token);

    AccessToken removeAccessToken(String token);

    RefreshToken removeRefreshToken(String refreshToken);
}
